﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.OData;
using System.Web.Http.OData.Query;

namespace Xinchen.SOA.Server.ServiceHosting
{
    public class ServiceObject : ApiController
    {
        protected string GetErrorMessage()
        {
            foreach (var item in ModelState)
            {
                foreach (var error in item.Value.Errors)
                {
                    if (string.IsNullOrWhiteSpace(error.ErrorMessage))
                    {
                        continue;
                    }
                    return error.ErrorMessage;
                }
            }
            return null;
        }

        public int ApplicationId { get; internal set; }
    }
}
